* ==============================================================================
* ==============================================================================
* IMF Book: IMFBOOK_Ch6_Code.do
*			Chapter 6: Conditionality and health outcomes
* ==============================================================================
use "IMFBOOK_Dataset.dta", clear
* ==============================================================================
* Generate variables
* ==============================================================================
encode ccode, gen(cid)
xtset cid year
* DVs
rename uhc_serv_cov_index_IHME uhc
rename neonatal_mort_IHME neonat
* Controls
rename fh_ipolity2_QOG demo
rename ny_gdp_pcap_kd_WDI gdppc
gen lngdppc = ln(gdppc)
rename war_UCDP war
rename sp_urb_totl_in_zs_WDI urban
rename sp_pop_dpnd_WDI dratio
rename dt_oda_odat_pc_zs_WDI odapc
gen lnodapc = ln(odapc)
rename ghes_per_cap_mean_IHME hpop
gen hlnrpop = ln(hpop)
* IMF selection
rename bca_ngdpd_WEO cab
gen IMFliq = ln(IMFliquidity)
* EVs
egen IMFunder = sum(IMF55), by(year)
* propensity for country to recieve conditions
egen varBA2TOT=mean(BA2TOT) if year>=1980 & year<=2017, by(cid)
gen intBA2TOT=varBA2TOT*IMFliq
gen SCsBA2 = SPCsTOT + PAsTOT
gen QCsBA2 = QPCsTOT
egen varSCsBA2=mean(SCsBA2) if year>=1980 & year<=2017, by(cid)
gen intSCsBA2=varSCsBA2*IMFliq
egen varQCsBA2=mean(QCsBA2) if year>=1980 & year<=2017, by(cid)
gen intQCsBA2=varQCsBA2*IMFliq
gen BA2RFP = BA2FP + BA2RTP
gen BA2ENT = BA2SOE + BA2PRI
gen BA2GOV = BA2ENV + BA2INS + BA2OTH + BA2SP
foreach cond in BA2DEB BA2ENV BA2EXT BA2FIN BA2FP BA2INS BA2LAB BA2OTH BA2POV BA2PRI BA2RTP BA2SOE BA2SP BA2RFP BA2ENT BA2GOV {
	egen var`cond'=mean(`cond') if year>=1980 & year<=2017, by(cid)
	gen int`cond'=var`cond'*IMFliq
	gen res`cond' = BA2TOT - `cond'
	egen varres`cond'=mean(res`cond') if year>=1980 & year<=2017, by(cid)
	gen intres`cond'=varres`cond'*IMFliq
}
* propensity for country to participate
egen varIMF55=mean(IMF55) if year>=1980 & year<=2017, by(cid)
gen intIMF55=varIMF55*IMFliq
xtset cid year
foreach var in uhc neonat lngdppc urban dratio war demo hlnrpop lnodapc cab IMFliq IMF55 BA1TOT BA2TOT SCsBA2 QCsBA2 BA2DEB BA2EXT BA2FIN BA2RFP BA2ENT BA2LAB BA2POV BA2GOV {
	gen L`var' = l.`var'
}
* ==============================================================================
* Factual statements
* ==============================================================================
* "The sample therefore includes 4,485 country-years across 195 countries, for 23 years per country."
xtsum uhc neonat if year>=1995 & year<=2017
* "The mean number of binding structural conditions, at 4.701 per programme year, thus corresponds with a 1.062-point decline in the universal health coverage index."
tabstat LSCsBA2 if year>=1995 & year<=2017 & LIMF55==1, s(n mean sd mi ma)
* "At the maximum number in our sample of 80 binding structural conditions in a given year, as occurred in Ukraine in 2000, the effect would correspond to a decline of 18.080."
sort LSCsBA2
list cname year LSCsBA2 IMFnn if !missing(LSCsBA2) & IMFnn==1
* "If we then raised the number to 25—as required of Kazakhstan in 1998 and Mongolia in 2000—our model would predict a score of 48.891."
sort LSCsBA2
list cname year LSCsBA2 IMFnn if !missing(LSCsBA2) & IMFnn==1
* "It is also tempting to consider what level of universal health coverage would be achieved if we set the number of binding structural conditions at its maximum of 80 (beyond the scope of our x-axis), as was the case in Ukraine for 2000. Our model would predict a universal health index score of 36.460; but do note how our 90% confidence interval becomes wider as the number of structural conditions increases. At 80 conditions, it would be between 25.279 and 47.641, which is a wide berth."
xtset cid year
qui: cmp setup
local DV "uhc"
local ctrl "l.lngdppc l.urban l.dratio l.demo l.war l.hlnrpop l.lnodapc i.cid ib2000.year"
local sele "\`ctrl' l.cab"
qui: cmp (`DV' = LIMF55 l.SCsBA2 l.QCsBA2 `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.SCsBA2 = l.intSCsBA2 `sele') (res: l.QCsBA2 = l.intQCsBA2 `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
margins, at(l.SCsBA2=(80) LIMF55=1) vsquish level(90) noestimcheck
* "If we then raised the number of conditions to 15—as was the case for Romania in 2002, Azerbaijan in 2000, Russia in 1996, Burkina Faso in 1995, Yemen in 1998, Kazakhstan in 1996, Vietnam in 1997, Sao Tome and Principe in 2001, Mauritania in 2000, and Gambia in 2008—our model would predict neonatal mortality of 27.283 per 1,000 live births; and at 25 conditions, 29.229 per 1,000 live births."
sort LSCsBA2
list cname year LSCsBA2 IMFnn if !missing(LSCsBA2) & IMFnn==1
* ==============================================================================
* Table 6.3. Descriptive statistics for health outcome measures, 1995-2017
* ==============================================================================
tabstat uhc neonat if year>=1995 & year<=2017, s(n mean sd mi ma) col(s)
* ==============================================================================
* Table 6.4. Descriptive statistics and sources for control variables, 1980-2017
* ==============================================================================
tabstat Llngdppc Lurban Ldratio Ldemo Lwar Lhlnrpop Llnodapc if year>=1995 & year<=2017, s(n mean sd) col(s)
* ==============================================================================
* Table 6.5. Effect of IMF conditionality on coverage of essential health services, 1995-2017
* ==============================================================================
xtset cid year
cmp setup
local DV "uhc"
local ctrl "l.lngdppc l.urban l.dratio l.demo l.war l.hlnrpop l.lnodapc i.cid ib2000.year"
local sele "\`ctrl' l.cab"
* controls only
eststo: reg `DV' `ctrl' if year>=1995 & year<=2017
* binding conditions
eststo: cmp (`DV' = LIMF55 l.BA2TOT `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2TOT = l.intBA2TOT `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* quantitative vs structural conditions
eststo: cmp (`DV' = LIMF55 l.SCsBA2 l.QCsBA2 `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.SCsBA2 = l.intSCsBA2 `sele') (res: l.QCsBA2 = l.intQCsBA2 `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
esttab, b(4) se(4) nogaps brackets star(+ 0.10 * 0.05 ** 0.01 *** 0.001) scalars(N_clust) sfmt(a4) drop(*cid *year)
estimates dir
estimates restore est2
test ([cond] l.intBA2TOT)
test ([LIMF55] l.intIMF55)
estimates restore est3
test ([cond] l.intSCsBA2)
test ([res] l.intQCsBA2)
test ([LIMF55] l.intIMF55)
eststo clear
* ==============================================================================
* Table 6.6 Effect of IMF conditionality on neonatal mortality rate, 1995-2017
* ==============================================================================
xtset cid year
cmp setup
local DV "neonat"
local ctrl "l.lngdppc l.urban l.dratio l.demo l.war l.hlnrpop l.lnodapc i.cid ib2000.year"
local sele "\`ctrl' l.cab"
* controls only
eststo: reg `DV' `ctrl' if year>=1995 & year<=2017
* binding conditions
eststo: cmp (`DV' = LIMF55 l.BA2TOT `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2TOT = l.intBA2TOT `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* quantitative vs structural conditions
eststo: cmp (`DV' = LIMF55 l.SCsBA2 l.QCsBA2 `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.SCsBA2 = l.intSCsBA2 `sele') (res: l.QCsBA2 = l.intQCsBA2 `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
esttab, b(4) se(4) nogaps brackets star(+ 0.10 * 0.05 ** 0.01 *** 0.001) scalars(N_clust) sfmt(a4) drop(*cid *year)
estimates dir
estimates restore est2
test ([cond] l.intBA2TOT)
test ([LIMF55] l.intIMF55)
estimates restore est3
test ([cond] l.intSCsBA2)
test ([res] l.intQCsBA2)
test ([LIMF55] l.intIMF55)
eststo clear
* ==============================================================================
* Table 6.7 Effect of IMF conditionality on additional health outcome measures, 1995-2017
* ==============================================================================
* SDG Goal 3.1 & 3.2
foreach DV of varlist mat_mort_ratio_IHME skilled_birth_attend_IHME under5_mort_IHME neonat {
	eststo: cmp (`DV' = LIMF55 l.SCsBA2 l.QCsBA2 `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.SCsBA2 = l.intSCsBA2 `sele') (res: l.QCsBA2 = l.intQCsBA2 `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
}
esttab, b(4) se(4) nogaps brackets star(+ 0.10 * 0.05 ** 0.01 *** 0.001) scalars(N_clust) sfmt(a4) drop(*cid *year)
estimates dir
local estno: display r(names)
foreach eq of local estno {
	estimates restore `eq'
	test ([cond] l.intSCsBA2)
	test ([res] l.intQCsBA2)
	test ([LIMF55] l.intIMF55)
}
eststo clear
* SDG Goal 3.3
foreach DV of varlist hiv_incid_IHME tb_incid_IHME malaria_incid_IHME hep_b_incid_IHME ntd_prev_IHME {
		eststo: cmp (`DV' = LIMF55 l.SCsBA2 l.QCsBA2 `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.SCsBA2 = l.intSCsBA2 `sele') (res: l.QCsBA2 = l.intQCsBA2 `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
}
esttab, b(4) se(4) nogaps brackets star(+ 0.10 * 0.05 ** 0.01 *** 0.001) scalars(N_clust) sfmt(a4) drop(*cid *year)
estimates dir
local estno: display r(names)
foreach eq of local estno {
	estimates restore `eq'
	test ([cond] l.intSCsBA2)
	test ([res] l.intQCsBA2)
	test ([LIMF55] l.intIMF55)
}
eststo clear
* SDG Goal 3.4, 3.5, 3.6, 3.7 & 3.8
foreach DV of varlist ncd_mort_IHME suicide_mort_IHME alcohol_use_IHME road_inj_mort_IHME fp_need_met_mod_IHME adol_birth_rate_IHME uhc {
		eststo: cmp (`DV' = LIMF55 l.SCsBA2 l.QCsBA2 `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.SCsBA2 = l.intSCsBA2 `sele') (res: l.QCsBA2 = l.intQCsBA2 `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
}
esttab, b(4) se(4) nogaps brackets star(+ 0.10 * 0.05 ** 0.01 *** 0.001) scalars(N_clust) sfmt(a4) drop(*cid *year)
estimates dir
local estno: display r(names)
foreach eq of local estno {
	estimates restore `eq'
	test ([cond] l.intSCsBA2)
	test ([res] l.intQCsBA2)
	test ([LIMF55] l.intIMF55)
}
eststo clear
* SDG Goal 3.9, 3a & 3b
foreach DV of varlist air_poll_mort_IHME wash_mort_IHME poisoning_mort_IHME smoking_prev_IHME vaccine_cov_IHME {
		eststo: cmp (`DV' = LIMF55 l.SCsBA2 l.QCsBA2 `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.SCsBA2 = l.intSCsBA2 `sele') (res: l.QCsBA2 = l.intQCsBA2 `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
}
esttab, b(4) se(4) nogaps brackets star(+ 0.10 * 0.05 ** 0.01 *** 0.001) scalars(N_clust) sfmt(a4) drop(*cid *year)
estimates dir
local estno: display r(names)
foreach eq of local estno {
	estimates restore `eq'
	test ([cond] l.intSCsBA2)
	test ([res] l.intQCsBA2)
	test ([LIMF55] l.intIMF55)
}
eststo clear
* SDG Goal 3c
foreach DV of varlist hw_dens_IHME hw_dens_nurse hw_dens_pharm hw_dens_physi {
		eststo: cmp (`DV' = LIMF55 l.SCsBA2 l.QCsBA2 `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.SCsBA2 = l.intSCsBA2 `sele') (res: l.QCsBA2 = l.intQCsBA2 `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
}
esttab, b(4) se(4) nogaps brackets star(+ 0.10 * 0.05 ** 0.01 *** 0.001) scalars(N_clust) sfmt(a4) drop(*cid *year)
estimates dir
local estno: display r(names)
foreach eq of local estno {
	estimates restore `eq'
	test ([cond] l.intSCsBA2)
	test ([res] l.intQCsBA2)
	test ([LIMF55] l.intIMF55)
}
eststo clear
* ==============================================================================
* Figure 6.1. Coverage of essential health services, 1995 and 2017
* ==============================================================================
preserve
*** get the shapefiles in order
capture cd "GIS"
spshape2dta "World_Countries__Generalized_.shp", replace saving(world)
*** explore the outline file
use world_shp, clear
geo2xy _Y _X, proj (web_mercator) replace
*** merge with attributes file to get the names
merge m:1 _ID using world
drop if COUNTRY=="Antarctica"
drop rec_header- _merge
sort _ID
save, replace
*** merging
use world, clear
ren COUNTRY cname             
drop if cname=="Antarctica"
replace cname="Bahamas, The" if cname=="Bahamas"
replace cname="Congo, Dem. Rep." if cname=="Congo DRC"
replace cname="Congo, Rep." if cname=="Congo"
replace cname="Cote d'Ivoire" if cname=="Côte d'Ivoire"
replace cname="Egypt, Arab Rep." if cname=="Egypt"
replace cname="Gambia, The" if cname=="Gambia"
replace cname="Iran, Islamic Rep." if cname=="Iran"
replace cname="Korea, Dem. People's Rep." if cname=="North Korea"
replace cname="Korea, Rep." if cname=="South Korea"
replace cname="Kyrgyz Republic" if cname=="Kyrgyzstan"
replace cname="Lao PDR" if cname=="Laos"
replace cname="Micronesia, Fed. Sts." if cname=="Micronesia"
replace cname="Sint Maarten (Dutch part)" if cname=="Sint Maarten"
replace cname="Slovak Republic" if cname=="Slovakia"
replace cname="St. Kitts and Nevis" if cname=="Saint Kitts and Nevis"
replace cname="St. Lucia" if cname=="Saint Lucia"
replace cname="St. Martin (French part)" if cname=="Saint Martin"
replace cname="St. Vincent and the Grenadines" if cname=="Saint Vincent and the Grenadines"
replace cname="Syrian Arab Republic" if cname=="Syria"
replace cname="Venezuela, RB" if cname=="Venezuela"
replace cname="Virgin Islands (U.S.)" if cname=="US Virgin Islands"
replace cname="West Bank and Gaza" if cname=="Palestinian Territory"
replace cname="Yemen, Rep." if cname=="Yemen"
merge 1:m cname using "..\IMFBOOK_Dataset.dta"
*** see which countries didn't merge
tab cname if _m==1
tab cname if _m==2 
*** generate a local for the color scheme
colorpalette spmap greys, n(4) nograph
local colors `r(p)'
spmap uhc_serv_cov_index_IHME using world_shp if year==1995, id(_ID) ocolor(black ..) osize(vvthin ..) fcolor("`colors'") legend(pos(7) size(*1)) legtitle("UHC index 1995") legstyle(2) ndfcolor(white ..) ndlabel("Missing") ndsize(vvthin ..) clmethod(custom) clbreaks(10 30 50 75 100)
graph export "..\Figures\IMFBOOK_Figure6-1a.png", replace width(4000)
spmap uhc_serv_cov_index_IHME using world_shp if year==2017, id(_ID) ocolor(black ..) osize(vvthin ..) fcolor("`colors'") legend(pos(7) size(*1)) legtitle("UHC index 2017") legstyle(2) ndfcolor(white ..) ndlabel("Missing") ndsize(vvthin ..) clmethod(custom) clbreaks(10 30 50 75 100)
graph export "..\Figures\IMFBOOK_Figure6-1b.png", replace width(4000)
capture cd ..
restore
* ==============================================================================
* Figure 6.2. Neonatal mortality rate, 1995 and 2017
* ==============================================================================
preserve
*** get the shapefiles in order
capture cd "GIS"
spshape2dta "World_Countries__Generalized_.shp", replace saving(world)
*** explore the outline file
use world_shp, clear
geo2xy _Y _X, proj (web_mercator) replace
*** merge with attributes file to get the names
merge m:1 _ID using world
drop if COUNTRY=="Antarctica"
drop rec_header- _merge
sort _ID
save, replace
*** merging
use world, clear
ren COUNTRY cname             
drop if cname=="Antarctica"
replace cname="Bahamas, The" if cname=="Bahamas"
replace cname="Congo, Dem. Rep." if cname=="Congo DRC"
replace cname="Congo, Rep." if cname=="Congo"
replace cname="Cote d'Ivoire" if cname=="Côte d'Ivoire"
replace cname="Egypt, Arab Rep." if cname=="Egypt"
replace cname="Gambia, The" if cname=="Gambia"
replace cname="Iran, Islamic Rep." if cname=="Iran"
replace cname="Korea, Dem. People's Rep." if cname=="North Korea"
replace cname="Korea, Rep." if cname=="South Korea"
replace cname="Kyrgyz Republic" if cname=="Kyrgyzstan"
replace cname="Lao PDR" if cname=="Laos"
replace cname="Micronesia, Fed. Sts." if cname=="Micronesia"
replace cname="Sint Maarten (Dutch part)" if cname=="Sint Maarten"
replace cname="Slovak Republic" if cname=="Slovakia"
replace cname="St. Kitts and Nevis" if cname=="Saint Kitts and Nevis"
replace cname="St. Lucia" if cname=="Saint Lucia"
replace cname="St. Martin (French part)" if cname=="Saint Martin"
replace cname="St. Vincent and the Grenadines" if cname=="Saint Vincent and the Grenadines"
replace cname="Syrian Arab Republic" if cname=="Syria"
replace cname="Venezuela, RB" if cname=="Venezuela"
replace cname="Virgin Islands (U.S.)" if cname=="US Virgin Islands"
replace cname="West Bank and Gaza" if cname=="Palestinian Territory"
replace cname="Yemen, Rep." if cname=="Yemen"
merge 1:m cname using "..\IMFBOOK_Dataset.dta"
*** see which countries didn't merge
tab cname if _m==1
tab cname if _m==2 
*** generate a local for the color scheme
colorpalette spmap greys, n(4) nograph
local colors `r(p)'
spmap neonatal_mort_IHME using world_shp if year==1995, id(_ID) ocolor(black ..) osize(vvthin ..) fcolor("`colors'") legend(pos(7) size(*1)) legtitle("Neonatal mortality 1995") legstyle(2) ndfcolor(white ..) ndlabel("Missing") ndsize(vvthin ..) clmethod(custom) clbreaks(0 10 30 45 65)
graph export "..\Figures\IMFBOOK_Figure6-2a.png", replace width(4000)
spmap neonatal_mort_IHME using world_shp if year==2017, id(_ID) ocolor(black ..) osize(vvthin ..) fcolor("`colors'") legend(pos(7) size(*1)) legtitle("Neonatal mortality 2017") legstyle(2) ndfcolor(white ..) ndlabel("Missing") ndsize(vvthin ..) clmethod(custom) clbreaks(0 10 30 45 65)
graph export "..\Figures\IMFBOOK_Figure6-2b.png", replace width(4000)
capture cd ..
restore
* ==============================================================================
* Figure 6.3. Coverage of essential health services, 1995-2017
* ==============================================================================
preserve
egen expBA=mean(BA2TOT) if year>=1995 & year<=2017, by(cid)
sum expBA if year>=1995 & year<=2017, d
gen highBA=(expBA>`r(p50)') if year>=1995 & year<=2017
egen meanuhc = mean(uhc) if year>=1995 & year<=2017, by(year)
egen highBAmean = mean(uhc) if year>=1995 & year<=2017 & highBA==1, by(year)
egen lowBAmean = mean(uhc) if year>=1995 & year<=2017 & highBA==0, by(year)
twoway (scatter meanuhc year if year>=1995 & year<=2017, sort(year) connect(l) msymbol(i) lp(solid) lw(thick)) (scatter highBAmean year if year>=1995 & year<=2017, sort(year) connect(l) msymbol(i) lp(dash) lw(thick)) (scatter lowBAmean year if year>=1995 & year<=2017, sort(year) connect(l) msymbol(i) lp(shortdash_dot) lw(thick)), graphregion(color(white)) legend(rows(3) label(1 "Mean of all countries") label(2 "Above-mean conditionality countries") label(3 "Below-mean conditionality countries")) ytitle("UHC index") ylabel(, angle(horizontal)) xlabel(1995(5)2020) scheme(s2mono)
graph export "Figures\IMFBOOK_Figure6-3.png", replace width(4000)
restore
* ==============================================================================
* Figure 6.4. Neonatal mortality rate, 1995-2017
* ==============================================================================
preserve
egen expBA=mean(BA2TOT) if year>=1995 & year<=2017, by(cid)
sum expBA if year>=1995 & year<=2017, d
gen highBA=(expBA>`r(p50)') if year>=1995 & year<=2017
egen meanneonat = mean(neonat) if year>=1995 & year<=2017, by(year)
egen highBAmean = mean(neonat) if year>=1995 & year<=2017 & highBA==1, by(year)
egen lowBAmean = mean(neonat) if year>=1995 & year<=2017 & highBA==0, by(year)
twoway (scatter meanneonat year if year>=1995 & year<=2017, sort(year) connect(l) msymbol(i) lp(solid) lw(thick)) (scatter highBAmean year if year>=1995 & year<=2017, sort(year) connect(l) msymbol(i) lp(dash) lw(thick)) (scatter lowBAmean year if year>=1995 & year<=2017, sort(year) connect(l) msymbol(i) lp(shortdash_dot) lw(thick)), graphregion(color(white)) legend(rows(3) label(1 "Mean of all countries") label(2 "Above-mean conditionality countries") label(3 "Below-mean conditionality countries")) ytitle("Neonatal mortality rate" "(per 1,000 live births)") ylabel(, angle(horizontal)) xlabel(1995(5)2020) scheme(s2mono)
graph export "Figures\IMFBOOK_Figure6-4.png", replace width(4000)
restore
* ==============================================================================
* Figure 6.5. Association between average annual coverage of essential health services and total number of binding conditions, 1995-2017
* ==============================================================================
preserve
egen totalBA2TOT = total(BA2TOT) if year>=1995 & year<=2017, by(cid)
egen meanuhc = mean(uhc) if year>=1995 & year<=2017, by(cid)
corr totalBA2TOT meanuhc if year>=1995 & year<=2017
local r: display %5.2f r(rho)
twoway (scatter meanuhc totalBA2TOT if year>=1995 & year<=2017, msymbol(i) mlab(ccode) mlabpos(0)) (lfit meanuhc totalBA2TOT if year>=1995 & year<=2017), legend(off) ytitle("UHC index") xtitle("Total number of conditions") ylabel(, angle(0)) note(r = `r', size(medsmall) placement(se)) graphregion(color(white)) scheme(s2mono)
graph export "Figures\IMFBOOK_Figure6-5.png", replace width(4000)
restore
* ==============================================================================
* Figure 6.6. Association between average annual neonatal mortality rate and total number of binding conditions, 1995-2017
* ==============================================================================
preserve
egen totalBA2TOT = total(BA2TOT) if year>=1995 & year<=2017, by(cid)
egen meanneonat = mean(neonat) if year>=1995 & year<=2017, by(cid)
corr totalBA2TOT meanneonat if year>=1995 & year<=2017
local r: display %5.2f r(rho)
twoway (scatter meanneonat totalBA2TOT if year>=1995 & year<=2017, msymbol(i) mlab(ccode) mlabpos(0)) (lfit meanneonat totalBA2TOT if year>=1995 & year<=2017), legend(off) ytitle("Neonatal mortality rate" "(per 1,000 live births)") xtitle("Total number of conditions") ylabel(, angle(0)) note(r = `r', size(medsmall) placement(se)) graphregion(color(white)) scheme(s2mono)
graph export "Figures\IMFBOOK_Figure6-6.png", replace width(4000)
restore
* ==============================================================================
* Figure 6.7. Effect of IMF structural conditionality on coverage of essential health services, with 95% and 90% confidence intervals
* ==============================================================================
xtset cid year
cmp setup
local DV "uhc"
local ctrl "l.lngdppc l.urban l.dratio l.demo l.war l.hlnrpop l.lnodapc i.cid ib2000.year"
local sele "\`ctrl' l.cab"
cmp (`DV' = LIMF55 l.SCsBA2 l.QCsBA2 `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.SCsBA2 = l.intSCsBA2 `sele') (res: l.QCsBA2 = l.intQCsBA2 `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
margins, at(l.SCsBA2=(0 5 10 15 20 25) LIMF55=1) vsquish level(95) noestimcheck saving(l95, replace)
margins, at(l.SCsBA2=(0 5 10 15 20 25) LIMF55=1) vsquish level(90) noestimcheck saving(l90, replace)
combomarginsplot l95 l90, recast(line) recastci(rarea) ytitle(Linear prediction: UHC index) ylabel(, angle(horizontal)) xtitle(Number of binding structural conditions) title("") graphregion(color(white)) scheme(s2mono) legend(off)
graph export "Figures\IMFBOOK_Figure6-7.png", replace width(4000)
erase l95.dta
erase l90.dta
* ==============================================================================
* Figure 6.8. Effect of IMF structural conditionality on neonatal mortality rate, with 95% and 90% confidence intervals
* ==============================================================================
xtset cid year
cmp setup
local DV "neonat"
local ctrl "l.lngdppc l.urban l.dratio l.demo l.war l.hlnrpop l.lnodapc i.cid ib2000.year"
local sele "\`ctrl' l.cab"
cmp (`DV' = LIMF55 l.SCsBA2 l.QCsBA2 `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.SCsBA2 = l.intSCsBA2 `sele') (res: l.QCsBA2 = l.intQCsBA2 `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
margins, at(l.SCsBA2=(0 5 10 15 20 25) LIMF55=1) vsquish level(95) noestimcheck saving(l95, replace)
margins, at(l.SCsBA2=(0 5 10 15 20 25) LIMF55=1) vsquish level(90) noestimcheck saving(l90, replace)
combomarginsplot l95 l90, recast(line) recastci(rarea) ytitle(Linear prediction: Neonatal mortality rate) ylabel(, angle(horizontal)) xtitle(Number of binding structural conditions) title("") graphregion(color(white)) scheme(s2mono) legend(off)
graph export "Figures\IMFBOOK_Figure6-8.png", replace width(4000)
erase l95.dta
erase l90.dta
* ==============================================================================
* Figure 6.9. Effect of IMF conditionality policy areas on coverage of essential health services, with 95% and 90% confidence intervals
* ==============================================================================
xtset cid year
cmp setup
local DV "uhc"
local ctrl "l.lngdppc l.urban l.dratio l.demo l.war l.hlnrpop l.lnodapc i.cid ib2000.year"
local sele "\`ctrl' l.cab"
* DEB
eststo: cmp (`DV' = LIMF55 l.BA2DEB l.resBA2DEB `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2DEB = l.intBA2DEB `sele') (res: l.resBA2DEB = l.intresBA2DEB `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* FIN
eststo: cmp (`DV' = LIMF55 l.BA2FIN l.resBA2FIN `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2FIN = l.intBA2FIN `sele') (res: l.resBA2FIN = l.intresBA2FIN `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* RFP
eststo: cmp (`DV' = LIMF55 l.BA2RFP l.resBA2RFP `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2RFP = l.intBA2RFP `sele') (res: l.resBA2RFP = l.intresBA2RFP `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* EXT
eststo: cmp (`DV' = LIMF55 l.BA2EXT l.resBA2EXT `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2EXT = l.intBA2EXT `sele') (res: l.resBA2EXT = l.intresBA2EXT `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* ENT 	
eststo: cmp (`DV' = LIMF55 l.BA2ENT l.resBA2ENT `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2ENT = l.intBA2ENT `sele') (res: l.resBA2ENT = l.intresBA2ENT `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* LAB
eststo: cmp (`DV' = LIMF55 l.BA2LAB l.resBA2LAB `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2LAB = l.intBA2LAB `sele') (res: l.resBA2LAB = l.intresBA2LAB `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* GOV
eststo: cmp (`DV' = LIMF55 l.BA2GOV l.resBA2GOV `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2GOV = l.intBA2GOV `sele') (res: l.resBA2GOV = l.intresBA2GOV `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* POV
eststo: cmp (`DV' = LIMF55 l.BA2POV l.resBA2POV `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2POV = l.intBA2POV `sele') (res: l.resBA2POV = l.intresBA2POV `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
esttab, b(4) se(4) nogaps brackets star(+ 0.10 * 0.05 ** 0.01 *** 0.001) scalars(N_clust) sfmt(a4) drop(*cid *year)
estimates dir
estimates restore est1
test ([cond] l.intBA2DEB)
test ([res] l.intresBA2DEB)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2DEB) noestimcheck level(90)
estimates restore est2
test ([cond] l.intBA2FIN)
test ([res] l.intresBA2FIN)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2FIN) noestimcheck level(90)
estimates restore est3
test ([cond] l.intBA2RFP)
test ([res] l.intresBA2RFP)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2RFP) noestimcheck level(90)
estimates restore est4
test ([cond] l.intBA2EXT)
test ([res] l.intresBA2EXT)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2EXT) noestimcheck level(90)
estimates restore est5
test ([cond] l.intBA2ENT)
test ([res] l.intresBA2ENT)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2ENT) noestimcheck level(90)
estimates restore est6
test ([cond] l.intBA2LAB)
test ([res] l.intresBA2LAB)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2LAB) noestimcheck level(90)
estimates restore est7
test ([cond] l.intBA2GOV)
test ([res] l.intresBA2GOV)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2GOV) noestimcheck level(90)
estimates restore est8
test ([cond] l.intBA2POV)
test ([res] l.intresBA2POV)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2POV) noestimcheck level(90)
coefplot (est1, offset(0)) est2 est3 est4 est5 est6 est7 est8, keep(`DV':L.BA2*) coeflabels(L.BA2DEB="External debt issues" L.BA2FIN=`""Financial, monetary" "& Central Bank"' L.BA2RFP=`""Fiscal issues," "revenues & taxation""' L.BA2EXT=`""External sector" "(trade & exchange)"' L.BA2ENT=`""SOE privatisation," "reform & pricing""' L.BA2LAB=`""Labour (public" "& private sector)""' L.BA2GOV="Institutional reforms" L.BA2POV="Poverty reduction") mcolor(black) ciopts(recast(. rcap) lcolor(black black)) xline(0, lcolor(black) lwidth(thin) lpattern(dash)) xtitle("Conditionality effect size") levels(95 90) nokey grid(within) graphregion(color(white))
graph export "Figures\IMFBOOK_Figure6-9.png", replace width(4000)
eststo clear
* ==============================================================================
* Figure 6.10. Effect of IMF conditionality policy areas on neonatal mortality rate, with 95% and 90% confidence intervals
* ==============================================================================
xtset cid year
cmp setup
local DV "neonat"
local ctrl "l.lngdppc l.urban l.dratio l.demo l.war l.hlnrpop l.lnodapc i.cid ib2000.year"
local sele "\`ctrl' l.cab"
* DEB
eststo: cmp (`DV' = LIMF55 l.BA2DEB l.resBA2DEB `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2DEB = l.intBA2DEB `sele') (res: l.resBA2DEB = l.intresBA2DEB `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* FIN
eststo: cmp (`DV' = LIMF55 l.BA2FIN l.resBA2FIN `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2FIN = l.intBA2FIN `sele') (res: l.resBA2FIN = l.intresBA2FIN `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* RFP
eststo: cmp (`DV' = LIMF55 l.BA2RFP l.resBA2RFP `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2RFP = l.intBA2RFP `sele') (res: l.resBA2RFP = l.intresBA2RFP `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* EXT
eststo: cmp (`DV' = LIMF55 l.BA2EXT l.resBA2EXT `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2EXT = l.intBA2EXT `sele') (res: l.resBA2EXT = l.intresBA2EXT `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* ENT 	
eststo: cmp (`DV' = LIMF55 l.BA2ENT l.resBA2ENT `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2ENT = l.intBA2ENT `sele') (res: l.resBA2ENT = l.intresBA2ENT `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* LAB
eststo: cmp (`DV' = LIMF55 l.BA2LAB l.resBA2LAB `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2LAB = l.intBA2LAB `sele') (res: l.resBA2LAB = l.intresBA2LAB `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* GOV
eststo: cmp (`DV' = LIMF55 l.BA2GOV l.resBA2GOV `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2GOV = l.intBA2GOV `sele') (res: l.resBA2GOV = l.intresBA2GOV `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
* POV
eststo: cmp (`DV' = LIMF55 l.BA2POV l.resBA2POV `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.BA2POV = l.intBA2POV `sele') (res: l.resBA2POV = l.intresBA2POV `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
esttab, b(4) se(4) nogaps brackets star(+ 0.10 * 0.05 ** 0.01 *** 0.001) scalars(N_clust) sfmt(a4) drop(*cid *year)
estimates dir
estimates restore est1
test ([cond] l.intBA2DEB)
test ([res] l.intresBA2DEB)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2DEB) noestimcheck level(90)
estimates restore est2
test ([cond] l.intBA2FIN)
test ([res] l.intresBA2FIN)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2FIN) noestimcheck level(90)
estimates restore est3
test ([cond] l.intBA2RFP)
test ([res] l.intresBA2RFP)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2RFP) noestimcheck level(90)
estimates restore est4
test ([cond] l.intBA2EXT)
test ([res] l.intresBA2EXT)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2EXT) noestimcheck level(90)
estimates restore est5
test ([cond] l.intBA2ENT)
test ([res] l.intresBA2ENT)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2ENT) noestimcheck level(90)
estimates restore est6
test ([cond] l.intBA2LAB)
test ([res] l.intresBA2LAB)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2LAB) noestimcheck level(90)
estimates restore est7
test ([cond] l.intBA2GOV)
test ([res] l.intresBA2GOV)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2GOV) noestimcheck level(90)
estimates restore est8
test ([cond] l.intBA2POV)
test ([res] l.intresBA2POV)
test ([LIMF55] l.intIMF55)
margins, dydx(l.BA2POV) noestimcheck level(90)
coefplot (est1, offset(0)) est2 est3 est4 est5 est6 est7 est8, keep(`DV':L.BA2*) coeflabels(L.BA2DEB="External debt issues" L.BA2FIN=`""Financial, monetary" "& Central Bank"' L.BA2RFP=`""Fiscal issues," "revenues & taxation""' L.BA2EXT=`""External sector" "(trade & exchange)"' L.BA2ENT=`""SOE privatisation," "reform & pricing""' L.BA2LAB=`""Labour (public" "& private sector)""' L.BA2GOV="Institutional reforms" L.BA2POV="Poverty reduction") mcolor(black) ciopts(recast(. rcap) lcolor(black black)) xline(0, lcolor(black) lwidth(thin) lpattern(dash)) xtitle("Conditionality effect size") levels(95 90) nokey grid(within) graphregion(color(white))
graph export "Figures\IMFBOOK_Figure6-10.png", replace width(4000)
eststo clear
* ==============================================================================
* Supplementary statistical code. Additional tests for post-treatment bias
* ==============================================================================
xtset cid year
cmp setup
local DV "uhc"
local ctrl "l.lngdppc l.urban l.dratio l.demo l.war l.lnodapc i.cid ib2000.year"
local sele "\`ctrl' l.cab"
* quantitative vs structural conditions
eststo: cmp (`DV' = LIMF55 l.SCsBA2 l.QCsBA2 `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.SCsBA2 = l.intSCsBA2 `sele') (res: l.QCsBA2 = l.intQCsBA2 `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
local DV "neonat"
local ctrl "l.lngdppc l.urban l.dratio l.demo l.war l.lnodapc i.cid ib2000.year"
local sele "\`ctrl' l.cab"
* quantitative vs structural conditions
eststo: cmp (`DV' = LIMF55 l.SCsBA2 l.QCsBA2 `ctrl') (LIMF55 = l.intIMF55 `sele') (cond: l.SCsBA2 = l.intSCsBA2 `sele') (res: l.QCsBA2 = l.intQCsBA2 `sele') if year>=1995 & year<=2017, indicators($cmp_cont $cmp_cont $cmp_cont $cmp_cont) cl(cid) iterate(50) difficult
esttab, b(4) se(4) nogaps brackets star(+ 0.10 * 0.05 ** 0.01 *** 0.001) scalars(N_clust) sfmt(a4) drop(*cid *year)
eststo clear
* ==============================================================================
